<template>
	<view class="page">
		<mp-html :content="html" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				html: '',
				code: ''
			}
		},
		onLoad(option) {
			this.code = option.code
		},
		onShow() {
			this.getDetail()
		},
		methods: {
			async getDetail() {
				let res = await this.$api.articleApi.detail({
					code: this.code
				})
				this.html = res.content
				uni.setNavigationBarTitle({
					title: res.title
				})
			},
		}
	}
</script>

<style lang="scss">
	.page {
		padding: 10rpx;
	}
</style>